// HardwareConfig.h
#pragma once

// 根据预编译指令设置硬件特性
#if defined(HAS_BLE) && HAS_BLE == 1
    #define BLE_SUPPORTED 1
#else
    #define BLE_SUPPORTED 0
#endif

#if defined(HAS_CLASSIC_BT) && HAS_CLASSIC_BT == 1
    #define CLASSIC_BT_SUPPORTED 1
#else
    #define CLASSIC_BT_SUPPORTED 0
#endif

// 内存配置
#if defined(EEPROM_SIZE)
    #define CONFIG_EEPROM_SIZE EEPROM_SIZE
#else
    #define CONFIG_EEPROM_SIZE 512
#endif

// 调试输出
#ifdef DEBUG
    #define DEBUG_PRINT(x) Serial.print(x)
    #define DEBUG_PRINTLN(x) Serial.println(x)
    #define DEBUG_PRINTF(...) Serial.printf(__VA_ARGS__)
#else
    #define DEBUG_PRINT(x)
    #define DEBUG_PRINTLN(x)
    #define DEBUG_PRINTF(...)
#endif

// 芯片型号检测
#ifdef CONFIG_IDF_TARGET_ESP32C2
    #define CHIP_ESP32_C2 1
    #define CHIP_NAME "ESP32-C2"
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
    #define CHIP_ESP32_C3 1
    #define CHIP_NAME "ESP32-C3"
#elif defined(CONFIG_IDF_TARGET_ESP32C6)
    #define CHIP_ESP32_C6 1
    #define CHIP_NAME "ESP32-C6"
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
    #define CHIP_ESP32_S3 1
    #define CHIP_NAME "ESP32-S3"
#else
    #define CHIP_ESP32 1
    #define CHIP_NAME "ESP32"
#endif

// 功能限制检查
inline bool isClassicBTSupported() {
    return CLASSIC_BT_SUPPORTED;
}

inline bool isBLESupported() {
    return BLE_SUPPORTED;
}

inline const char* getChipName() {
    return CHIP_NAME;
}